num = eval(input("请输入一个数字："))
# num = 7
for i in range(0,num+1):
    for j in range(0,num-i):
        print(format("","4s"), end=' ')
    for j in range(0,i+1):
        print(format(2**j,"4d"), end=' ')
    for j in range(i,0,-1):
        print(format(2**(j-1),"4d"),end=' ')

    print()